<template>
  <div class="title">
    <slot v-if="cusIcon" name="icon"></slot>
    <span v-else class="line"></span>
    <span class="name">{{ title }}</span>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'

export default defineComponent({
  name: 'CusTitle',
  components: {},
  props: {
    cusIcon: {
      type: Boolean,
      default: false
    },
    title: {
      type: String,
      default: ''
    }
  },
  setup() {
    return {}
  }
})
</script>

<style lang="stylus" scoped>
.title
  display flex
  align-items: center
  margin-bottom 16px
  .line
    display inline-block
    width 4px
    height 16px
    background: var(--mc-main-color)
    border-radius: 2px
  .name
    margin-left 8px
    font-size 16px
    font-weight 500
</style>
